import request from '@/utils/request'

export function login(data) {
  return request({
    // url: '/vue-element-admin/user/login',
    // url: '/admin/auth/login',
    // 代理要求以api开头，多写了一个api,之后config.js里在代理里除去api
    // url: '/api/admin/auth/login',
    url: '/admin/auth/login',
    method: 'post',
    data
  })
}

export function getInfo(token) {
  return request({
    // url: '/api/admin/auth/info',
    url: '/admin/auth/info',
    method: 'get',
    params: { token }
  })
}

export function logout(token) {
  return request({
    // url: '/api/admin/auth/logout',
    url: '/admin/auth/logout',
    method: 'post',
    params: { token }
  })
}
